package com.example.demo.mapper;

import com.example.demo.enumeration.Campus;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CampusMapper {

    @Insert("insert into campus (item_id, campus, create_time, update_time) values (#{itemId}, #{campus}, now(), now())")
    boolean addCampus(Long itemId, Campus campus);

    @Select("select campus from campus where item_id = #{itemId}")
    List<Campus> selectCampusByItemId(Long itemId);

    @Delete("delete from campus where item_id = #{itemId}")
    boolean deleteCampusByItemId(Long itemId);
}
